package com.voice.client.message.entity;

import com.voice.client.message.callback.MessageCallback;
import org.springframework.util.AntPathMatcher;

public class SubscribeInfo {

    private String topic;
    private MessageCallback callback;
    private AntPathMatcher antPathMatcher;

    public SubscribeInfo(String topic, MessageCallback callback) {
        this.topic = topic;
        this.callback = callback;
    }

    public String getTopic() {
        return this.topic;
    }

    public MessageCallback getCallback() {
        return this.callback;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public void setCallback(MessageCallback callback) {
        this.callback = callback;
    }

    public boolean isMatch(String topic){
        return antPathMatcher.match(this.topic,topic);
    }
}
